package com.mhc.suzuki.manager.impl;

import com.mhc.suzuki.dal.mapper.ext.PostBankCardExtMapper;
import com.mhc.suzuki.dal.model.PostBankCardDO;
import com.mhc.suzuki.dal.query.PostBankCardQuery;
import com.mhc.suzuki.manager.PostBankCardManager;
import com.subaru.common.query.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * Manager for PostBankCard.
 */

@Component
public class PostBankCardManagerImpl implements PostBankCardManager {


    @Autowired
    protected PostBankCardExtMapper postBankCardExtMapper;

    /**
     * query count by query condition.
     */
    @Override
    public int countByQuery(PostBankCardQuery query) {
        return postBankCardExtMapper.countByQuery(query);
    }

    /**
     * delete by query condition.
     */
    @Override
    public int deleteByQuery(PostBankCardQuery query) {
        return postBankCardExtMapper.deleteByQuery(query);
    }

    /**
     * delete by primary key.
     */
    @Override
    public int deleteByPrimaryKey(PostBankCardDO record) {
        return postBankCardExtMapper.deleteByPrimaryKey(record);
    }

    /**
     * insert selective.
     */
    @Override
    public long insertSelective(PostBankCardDO record) {
        return postBankCardExtMapper.insertSelective(record);
    }

    /**
     * select by query condition.
     */
    @Override
    public List<PostBankCardDO> selectByQuery(PostBankCardQuery query) {
        return postBankCardExtMapper.selectByQuery(query);
    }

    /**
     * select by query condition with page.
     */
    @Override
    public PageResult<PostBankCardDO> selectByQueryWithPage(PostBankCardQuery query) {
        PageResult<PostBankCardDO> result = new PageResult<PostBankCardDO>();
        result.setPageSize(query.getPageSize());
        result.setPageNo(query.getPageNo());
        result.setTotalCount(this.countByQuery(query));
        result.setResult(this.selectByQuery(query));
        return result;
    }

    /**
     * select by primary key.
     */
    @Override
    public PostBankCardDO selectByPrimaryKey(Long id) {
        return postBankCardExtMapper.selectByPrimaryKey(id);
    }

    /**
     * select by primary key.
     */
    @Override
    public PostBankCardDO selectByOrderNo(String orderNo) {
        return postBankCardExtMapper.selectByOrderNo(orderNo);
    }

    /**
     * update by query condition selective.
     */
    @Override
    public int updateByQuerySelective(PostBankCardDO record, PostBankCardQuery query) {
        return postBankCardExtMapper.updateByQuerySelective(record, query);
    }

    /**
     * update by query condition.
     */
    @Override
    public int updateByQuery(PostBankCardDO record, PostBankCardQuery query) {

        return postBankCardExtMapper.updateByQuery(record, query);
    }

    /**
     * update by primary key selective.
     */
    @Override
    public int updateByPrimaryKeySelective(PostBankCardDO record) {
        return postBankCardExtMapper.updateByPrimaryKeySelective(record);
    }
}
